#ifndef COMPLEX
#define COMPLEX

#include <iostream>

class Complex {
  double re, im;
public:
  Complex():re(0),im(0){}
  Complex(double r):re(r),im(0){}
  Complex(double x, double y):re(x),im(y){}
 
 /* So we can initialize a Complex as: 
     Complex b=3; 
     Complex c(22,16);
     Complex d;
   Also these declarations are useful  for conversions:
   ie, although we define only  Complex operator+(Complex c2)
   we can do: b=22+c; and it will automatically convert 22 to a Complex
      */

  void show_Complex() {
    cout << re << " ";
    cout << im << "\n";
  }

  Complex operator+(Complex c2);
  Complex operator+=(Complex c2);
  Complex operator-(Complex c2);
  Complex operator-=(Complex c2);
  Complex operator*(Complex c2);
  Complex operator*=(Complex c2);
  Complex operator/(Complex c2);
  Complex operator/=(Complex c2);
  Complex operator=(Complex c2);
  
  /* Useful functions */
  double real()  {return re;}
  double imag()  {return im;} 
   
 friend double abs(Complex c2);

  friend  ostream& operator<<(ostream& s,Complex a)
    { return s<<" "<<a.real()<<"  "<<a.imag()<<"  "; } 
};

#endif
